<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<script type="text/javascript"> 
$(document).ready(function () {  
    /* 根据省份获取城市 */  
    $("#storeType").change(function () {  
        $.post("${dynamicURL}/basicdata/queryStoreJson.action", {storeType:$("#storeType").val()}, function (data) {  
            /* 清空城市 */  
            $("#storeIdName option[value!='']").remove();  
             var jsonObj = eval(data);  
            for (var i = 0; i < jsonObj.length; i++) {  
                var $option = $("<option></option>");  
                $option.attr("value", jsonObj[i].id);  
                $option.text(jsonObj[i].name);  
                $("#storeIdName").append($option);  
            }  
        });  
    });  
}); 
</script>

<div class="section">	
	<div class="box">
		<div class="title">
			查询条件
			<span class="hide"></span>
		</div>
		<div class="content">
			<s:form action="searchAsnHeader" namespace="/asn" method="post" id="searchForm">
				<s:hidden name="actionCommand" id="actionCommand" />
				<table>
					<tr>
						<td>入库类型:<s:select name="searchModel.type" list="asnTypeList" listKey="id" listValue="name" headerKey="" headerValue="所有"/></td>
						<td>开始时间:<sj:datepicker name="searchModel.startDate" timepicker="false" displayFormat="yy-mm-dd"/></td>
						<td>结束时间:<sj:datepicker name="searchModel.endDate" timepicker="false" displayFormat="yy-mm-dd"/></td>
					</tr>
					<tr>
						<td>&nbsp;&nbsp;&nbsp;&nbsp;状&nbsp;&nbsp;态:<s:select name="searchModel.status" list="asnStatusList" listKey="id" listValue="name" /></td>
						<td>&nbsp;&nbsp;供应商:<s:select name="searchModel.supplierId" list="supplierList" listKey="id" listValue="name" headerKey="" headerValue="所有"/></td>
						<td>门店类型:<s:select id="storeType" name="searchModel.storeType" list="storeTypeList" listKey="id" listValue="name" headerKey="" headerValue="所有" /></td>
					</tr>
					<tr>
						<td>&nbsp;&nbsp;&nbsp;&nbsp;门&nbsp;&nbsp;店:<s:select id="storeIdName"  name="searchModel.storeId" list="storeList" listKey="id" listValue="name" headerKey="" headerValue="所有"/></td>
						<td>门店代码:<s:textfield name="searchModel.storeCode" /></td>
						<td>门店名称:<s:textfield name="searchModel.storeName" /></td>
					</tr>
					<s:if test="actionCommand=='query'">
						<tr>
							<td colspan="3">
								<button type="button" class="green" onclick="searchFormFunc('searchAsnHeader');"><span>查询</span></button>
								<button type="button" class="blue" onclick="printForm()"><span>打印</span></button>
							</td>
						</tr>
					</s:if>
					<s:elseif test="actionCommand=='audit' || actionCommand=='unaudit'">
						<tr>
							<td colspan="5">
								<button type="button" class="green" onclick="searchFormFunc('searchAsnHeader');"><span>查询</span></button>
								<button type="button" class="blue" onclick="updateAsnHeader('audit');"><span>审核</span></button>
								<button type="button" class="red" onclick="updateAsnHeader('unaudit')"><span>反审核</span></button>
							</td>
						</tr>												
					</s:elseif>
					<s:elseif test="actionCommand=='account' || actionCommand=='unaccount'">
						<tr>
							<td colspan="5">
								<button type="button" class="green" onclick="searchFormFunc('searchAsnHeader');"><span>查询</span></button>
								<button type="button" class="blue" onclick="updateAsnHeader('account');"><span>过账</span></button>
								<button type="button" class="red" onclick="updateAsnHeader('unaccount')"><span>反过账</span></button>
							</td>
						</tr>												
					</s:elseif>													
				</table>
			</s:form>
		</div>
	</div>
	<div class="box">		
		<div style="margin: 10px">
			<s:hidden name="asnHeader.id" id="thisroleid" />
			
			<div  id="roleInRoleListDiv" style="margin-top: 5px">
				<table id="roleInRoleList"></table> 
			    <div id="roleInRolePager"></div>   
			</div> 
		</div>
	</div>
</div>

